package com.ycjedu.application.controller;

import com.ycjedu.application.service.HelloService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author ycj
 * @version 1.0
 * @description: TODO
 * @date 2022/11/4
 */
@Controller
public class HelloController {
    @DubboReference(interfaceClass = HelloService.class, version = "1.0.0", timeout = 10000, group = "group1")
    private HelloService helloService;

    @RequestMapping(value = "/rpcHello")
    @ResponseBody
    public String rpcHello(String name) {
        String result = helloService.sayHello(name);
        return "远程调用成功 获得结果: " + result;
    }
}
